<?php
class PicArticleWidget extends CWidget{
	
	public function init(){
		
	}
	
	public function run(){
		$picList = Article::model()->getPicArticle(array(10), array(), 6);
		$html = '';
		foreach($picList as $v){
			$html .= '<li><a href="'.Yii::app()->controller->createUrl('detail/index',array('article_id'=>$v['article_id'])).'" target="_blank"><img src="'.$v['pic'].'" alt="'.$v['title'].'" width="117" height="87"/></a></br /><a href="'.Yii::app()->controller->createUrl('detail/index',array('article_id'=>$v['article_id'])).'" target="_blank">'.mb_substr($v['title'], 0, 8,'utf-8').'</a></li>';
		}
		echo $html;
	}
}